<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
    <style>
        p{
            font-size: 40px;
            text-align: center;
        }
    </style>
<body>
    <p></p>
</body>
<script>
    function getDiff(s1, s2) {
        var days = s2.getTime() - s1.getTime();
        var time = parseInt(days / (1000 * 60 * 60 * 24));
        return time;
    }

    var hi1 = new Date('2020/08/14');
    var hi2 = new Date();
    var hi = getDiff(hi1, hi2);
    var p = document.querySelector('p')
    p.innerText = '我们已经在一起'+hi+'天了'
</script>

</html>